<template>
  <div class="hema-toast-wrapper">
    <transition name="fade">
      <div class="container" v-if="isShow">
        <span>{{url}}</span>
      </div>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'toast',
  props:{
    url: String
  },
  data() {
    return {
      isShow: false,
    };
  },
  mounted() {
    this.isShow = true;
    setTimeout(() => {
      this.isShow = false;
    }, 1500);
  },
};
</script>
<style scoped>
.hema-toast-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.container {
  padding: 16px;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  background-color: #5e5e5e;
}
.fade-enter-active,
.fade-leave-active {
  transition: all 0.5s;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}

.fade-enter-to,
.fade-leave {
  opacity: 1;
}
</style>

